/**
 * saga 6年前更新已淘汰
 */

// redux
import { createStore, applyMiddleware } from 'redux'
import reducers from './reducers'
// saga
import createSagaMiddleware from 'redux-saga'
import rootSaga from './saga'
const sagaMiddleware = createSagaMiddleware()

// init - 无中间件
// const store = createStore(reducers) // 如果不适用中间件 saga 则不需要

// init - saga
// @ts-ignore
const store = createStore(reducers, applyMiddleware(sagaMiddleware))
sagaMiddleware.run(rootSaga)
export default store

// export type RootState = ReturnType<typeof store.getState> reducers 也有导出
